package com.cht.commonUtil.svn.handler;

import org.tmatesoft.svn.core.ISVNDirEntryHandler;
import org.tmatesoft.svn.core.SVNDirEntry;
import org.tmatesoft.svn.core.SVNException;

public class TrunkCopyHandler implements ISVNDirEntryHandler {

	public void handleDirEntry(SVNDirEntry entry) throws SVNException {
		String path = entry.getRelativePath();
		if ( path.indexOf("branch/") ==0 ) {/*
			if ( Widgets.numberOfKeywords(path,"/") == 1 ) {
				
				
				
				
				res += "{'id':'"+path+"','pId':'"+parentDir+"','open':'true','name':'"+entry.getName()+"','icon':'./pic/folder.gif'},";
			}
			
			
			if (path.contains("/")) {
				parentDir= path.substring(0,path.lastIndexOf("/"));
			} else {
				parentDir = "rroott";
			}
			
			if ( entry.getKind() == SVNNodeKind.DIR ) {
				//名和值都有單引號
				if ( path.equalsIgnoreCase("trunk") ) {
					res += "{'id':'"+path+"','pId':'"+parentDir+"','open':'true','name':'"+entry.getName()+"','icon':'./pic/folder.gif'},";	
				} else if ( path.indexOf("branch/") ==0 ) {
					if ( numberOfKeywords(path,"/") == 1 ) {
						res += "{'id':'"+path+"','pId':'"+parentDir+"','open':'true','name':'"+entry.getName()+"','icon':'./pic/folder.gif'},";
					}
				}
			}
		*/}
	}

}
